FROM registry.cn-beijing.aliyuncs.com/duo-pub/maven:3.6.3-openjdk-11 AS builder

WORKDIR /app

COPY ./docker/settings.xml /root/.m2/settings.xml
COPY . .

RUN mvn clean package -Dmaven.test.skip=true -Dgpg.skip=true -Dmaven.javadoc.skip=true -pl duo-doc-demo-bootstrap -am



FROM registry.cn-beijing.aliyuncs.com/duo-pub/adoptopenjdk:11-jre-hotspot

LABEL maintainer="ycoe12@gmail.com"

ENV TZ=Asia/Shanghai

WORKDIR /app

RUN mkdir -p /app/lib && \
    mkdir -p /app/bin

COPY --from=builder /app/duo-doc-demo-bootstrap/target/duo-doc-demo-bootstrap-1.0.0-SNAPSHOT.jar lib/app.jar
COPY ./docker/start.sh /app/bin/start.sh

#RUN apt update && \
#    apt install vim procps net-tools iputils-ping -y \
#    && apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /var/cache/apk/*

EXPOSE 17040

CMD ["bash", "/app/bin/start.sh"]
